home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / commands.c < prev    next >
C/C++ Source or Header  |  1995-05-11  |  17KB  |  733 lines

  1. /* commands.c 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* $Id: commands.c,v 4.19 1995/05/11 12:23:43 espie Exp espie $
  6.  * $Log: commands.c,v $
  7.  * Revision 4.19  1995/05/11  12:23:43  espie
  8.  * Corrected DELAY, SET_LOOP (+1), and volslide.
  9.  *
  10.  * Revision 4.18  1995/03/11  21:40:25  espie
  11.  * Added jump_pattern, invert_loop.
  12.  *
  13.  * Revision 4.17  1995/03/04  00:15:48  espie
  14.  * Implemented vibrato control.
  15.  *
  16.  * Revision 4.16  1995/03/01  15:24:51  espie
  17.  * tone portamento and set offset more conformant to protracker.
  18.  *
  19.  * Revision 4.15  1995/02/25  15:43:11  espie
  20.  * Bug in tremolo FIXED !!!
  21.  *
  22.  * Revision 4.14  1995/02/21  21:13:16  espie
  23.  * Cleaned up source. Moved minor pieces of code around.
  24.  *
  25.  * Revision 4.13  1995/02/21  17:54:32  espie
  26.  * Internal problem: buggy RCS. Fixed logs.
  27.  *
  28.  * Revision 4.11  1995/02/20  22:28:50  espie
  29.  * tremolo
  30.  *
  31.  * Revision 4.10  1995/02/20  16:49:58  espie
  32.  * Checked in new commands, fixed bug in set_finetune:
  33.  * need to adjust the frequency of the current note according to
  34.  * the new finetune.
  35.  *
  36.  * Revision 4.8  1995/02/06  14:50:47  espie
  37.  * Changed sample_info.
  38.  *
  39.  * Revision 4.6  1995/02/01  16:39:04  espie
  40.  * Includes moved to defs.h
  41.  *
  42.  * Revision 4.2  1994/08/23  18:19:46  espie
  43.  * Added speedmode option
  44.  * Abstracted IO.
  45.  * Some notice to status.
  46.  * play_note instead of ch->mode.
  47.  * Fixed bug with bad loops.
  48.  * Modified the way set_speed works.
  49.  * Very small bug with volume (Lawrence).
  50.  * Added bg/fg test.
  51.  * More precise vibrato table.
  52.  *
  53.  * Revision 2.12  1992/11/13  13:24:24  espie
  54.  * Added some extended commands: E12AB, and some.
  55.  * now use set_volume in audio.c. All the device-dependent operation
  56.  * is there.
  57.  * Defensive programming: check the range of each note
  58.  * for arpeggio setup.
  59.  * Structured part of the code, especially replay ``automaton''
  60.  * and setting up of effects.
  61.  *
  62.  * Revision 1.9  1991/11/17  17:09:53  espie
  63.  * Added missing prototypes.
  64.  * Dynamic oversample and frequency.
  65.  * Added arpeggio.
  66.  * Fixed up vibrato depth.
  67.  * Added vibslide and portaslide.
  68.  * Added command 9.
  69.  */
  70.  
  71.  
  72. #include "defs.h"
  73. #include "channel.h"
  74. #include "song.h"
  75. #include "extern.h"
  76. #include "prefs.h"
  77.      
  78. ID("$Id: commands.c,v 4.19 1995/05/11 12:23:43 espie Exp espie $")
  79.  
  80. /* sine table for the vibrato effect (obtained through build_vibrato.c) */
  81.  
  82. int vibrato_table[3][64] = 
  83.     {
  84.    {
  85.    0,50,100,149,196,241,284,325,362,396,426,452,473,490,502,510,512,
  86.    510,502,490,473,452,426,396,362,325,284,241,196,149,100,50,0,-49,
  87.    -99,-148,-195,-240,-283,-324,-361,-395,-425,-451,-472,-489,-501,
  88.    -509,-511,-509,-501,-489,-472,-451,-425,-395,-361,-324,-283,-240,
  89.    -195,-148,-99,-49
  90.    },
  91.     {
  92.     512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,
  93.     512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,-512,-512,
  94.     -512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512, 
  95.     -512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,-512,
  96.     -512,-512
  97.     },
  98.     {
  99.     0,16,32,48,64,80,96,112,128,144,160,176,192,208,224,240,256,272,288,
  100.     304,320,336,352,368,384,400,416,432,448,464,480,496,-512,-496,-480,
  101.     -464,-448,-432,-416,-400,-384,-368,-352,-336,-320,-304,-288,-272,-256,
  102.     -240,-224,-208,-192,-176,-160,-144,-128,-112,-96,-80,-64,-48,-32,-16
  103.     }
  104.     };
  105.  
  106. /***    setting up effects/doing effects :
  107.  ***        set_xxx gets called while parsing the effect,
  108.  ***         do_xxx gets called each tick, and update the
  109.  ***        sound parameters while playing.
  110.  ***/
  111.  
  112.  
  113.  
  114.  
  115. /***
  116.  ***    base effects
  117.  ***/
  118.  
  119. void do_nothing(ch)
  120. struct channel *ch;
  121.    {
  122.    }
  123.  
  124. LOCAL void not_implemented(a, ch)
  125. struct automaton *a;
  126. struct channel *ch;
  127.     {
  128.     notice("Not implemented");
  129.     }
  130.  
  131. LOCAL void set_nothing(a, ch)
  132. struct automaton *a;
  133. struct channel *ch;
  134.    {
  135.    }
  136.  
  137. /* slide pitch (up or down) */
  138. LOCAL void do_slide(ch)
  139. struct channel *ch;
  140.    {
  141.    ch->pitch += ch->slide;
  142.    ch->pitch = MIN(ch->pitch, MAX_PITCH);
  143.    ch->pitch = MAX(ch->pitch, MIN_PITCH);
  144.    set_current_pitch(ch, ch->pitch);
  145.    }
  146.  
  147. LOCAL void set_upslide(a, ch)
  148. struct automaton *a;
  149. struct channel *ch;
  150.    {
  151.    ch->adjust = do_slide;
  152.    if (a->para)
  153.       ch->slide = a->para;
  154.    }
  155.  
  156. LOCAL void set_downslide(a, ch)
  157. struct automaton *a;
  158. struct channel *ch;
  159.    {
  160.    ch->adjust = do_slide;
  161.    if (a->para)
  162.       ch->slide = -a->para;
  163.    }
  164.  
  165. /* modulate the pitch with vibrato */
  166. LOCAL void do_vibrato(ch)
  167. struct channel *ch;
  168.    {
  169.    int offset;
  170.  
  171.       /* this is no longer a literal transcription of the pt
  172.        * code. I have rescaled the vibrato table.
  173.        */
  174.    ch->viboffset += ch->vibrate;
  175.    ch->viboffset &= 63;
  176.       /* please don't use logical shift on signed values */
  177.    offset = (ch->vibtable[ch->viboffset] * ch->vibdepth)/256;
  178.       /* temporary update of only the step value,
  179.        * note that we do not change the saved pitch.
  180.        */
  181.    set_current_pitch(ch, ch->pitch + offset);
  182.    }
  183.  
  184. LOCAL void set_vibrato(a, ch)
  185. struct automaton *a;
  186. struct channel *ch;
  187.    {
  188.    ch->adjust = do_vibrato;
  189.    if (HI(a->para))
  190.       ch->vibrate = HI(a->para);
  191.    if (LOW(a->para))
  192.       ch->vibdepth = LOW(a->para);
  193.     if (ch->resetvib)
  194.         ch->viboffset = 0;
  195.    }
  196.  
  197. LOCAL void do_tremolo(ch)
  198. struct channel *ch;
  199.     {
  200.     int offset;
  201.  
  202.     ch->tremoffset += ch->tremrate;
  203.     ch->tremoffset &= 63;
  204.  
  205.     offset = (ch->tremtable[ch->tremoffset] * ch->tremdepth)/128;
  206.  
  207.     set_temp_volume(ch, ch->volume + offset);
  208.     }
  209.  
  210. LOCAL void set_tremolo(a, ch)
  211. struct automaton *a;
  212. struct channel *ch;
  213.     {
  214.     ch->adjust = do_tremolo;
  215.     if (HI(a->para))
  216.         ch->tremrate = HI(a->para);
  217.     if (LOW(a->para))
  218.         ch->tremdepth = LOW(a->para);
  219.     if (ch->resettrem)
  220.         ch->tremoffset = 0;
  221.     }
  222.  
  223. /* arpeggio looks a bit like chords: we alternate between two
  224.  * or three notes very fast.
  225.  */
  226. LOCAL void do_arpeggio(ch)
  227. struct channel *ch;
  228.    {
  229.    if (++ch->arpindex >= MAX_ARP)
  230.       ch->arpindex =0;
  231.    set_current_pitch(ch, ch->arp[ch->arpindex]);
  232.    }
  233.  
  234. LOCAL void set_arpeggio(a, ch)
  235. struct automaton *a;
  236. struct channel *ch;
  237.    {
  238.       /* arpeggio can be installed relative to the
  239.        * previous note, so we have to check that there
  240.        * actually is a current(previous) note
  241.        */
  242.    if (ch->note == NO_NOTE)
  243.       {
  244.       status("No note present for arpeggio");
  245.       error = FAULT;
  246.       }
  247.    else
  248.       {
  249.       int note;
  250.  
  251.       ch->arp[0] = pitch_table[ch->note][ch->finetune];
  252.       note = ch->note + HI(a->para);
  253.       if (note < NUMBER_NOTES)
  254.          ch->arp[1] = pitch_table[note][ch->finetune];
  255.       else
  256.          {
  257.          status("Arpeggio note out of range");
  258.          error = FAULT;
  259.          }
  260.       note = ch->note + LOW(a->para);
  261.       if (note < NUMBER_NOTES)
  262.          ch->arp[2] = pitch_table[note][ch->finetune];
  263.       else
  264.          {
  265.          status("Arpeggio note out of range");
  266.          error = FAULT;
  267.          }
  268.       ch->arpindex = 0;
  269.       ch->adjust = do_arpeggio;
  270.       }
  271.    }
  272.  
  273. /* volume slide. Mostly used to simulate waveform control.
  274.  * (attack/decay/sustain).
  275.  */
  276. LOCAL void do_slidevol(ch)
  277. struct channel *ch;
  278.    {
  279.    set_current_volume(ch, ch->volume + ch->volumerate);
  280.    }
  281.  
  282. /* note that volumeslide does not have a ``take default''
  283.  * behavior. If para is 0, this is truly a 0 volumeslide.
  284.  * Issue: is the test really necessary ? Can't we do
  285.  * a HI(para) - LOW(para). Answer: protracker does not.
  286.  * DON'T GET the test order wrong!!! or ghouls will sound strange
  287.  */
  288. LOCAL void parse_slidevol(ch, para)
  289. struct channel *ch;
  290. int para;
  291.    {
  292.    if (HI(para))
  293.       ch->volumerate = HI(para);
  294.    else
  295.       ch->volumerate = -LOW(para);
  296.    }
  297.  
  298. LOCAL void set_slidevol(a, ch)
  299. struct automaton *a;
  300. struct channel *ch;
  301.    {
  302.    ch->adjust = do_slidevol;
  303.    parse_slidevol(ch, a->para);
  304.    }
  305.  
  306. /* portamento goes from a given pitch to another.  We could optimize 
  307.  * that effect by splitting the routine into a pitch up/pitch down 
  308.  * part while setting up the effect.
  309.  */
  310. LOCAL void do_portamento(ch)
  311. struct channel *ch;
  312.    {
  313.    if (ch->pitch < ch->pitchgoal)
  314.       {
  315.       ch->pitch += ch->pitchrate;
  316.         if (ch->pitch >= ch->pitchgoal)
  317.             {
  318.             ch->pitch = ch->pitchgoal;
  319.             ch->pitchgoal = 0;        /* ch->pitchgoal reset in protracker */
  320.             ch->adjust = do_nothing;
  321.             }
  322.       }
  323.    else if (ch->pitch > ch->pitchgoal)
  324.       {
  325.       ch->pitch -= ch->pitchrate;
  326.         if (ch->pitch <= ch->pitchgoal)
  327.             {
  328.             ch->pitch = ch->pitchgoal;
  329.             ch->pitchgoal = 0;        /* ch->pitchgoal reset in protracker */
  330.             ch->adjust = do_nothing;
  331.             }
  332.       }
  333.         /* funk glissando: round to the nearest note each time */
  334.     if (ch->funk_glissando)
  335.         set_current_pitch(ch, nearest_note(ch->pitch, ch->finetune));
  336.     else
  337.         set_current_pitch(ch, ch->pitch);
  338.    }
  339.  
  340. /* if para and pitch are 0, this is obviously a continuation
  341.  * of the previous portamento.
  342.  */
  343. LOCAL void set_portamento(a, ch)
  344. struct automaton *a;
  345. struct channel *ch;
  346.    {
  347.    if (a->para)
  348.       ch->pitchrate = a->para;
  349.    if (a->pitch)
  350.       ch->pitchgoal = a->pitch;
  351.     if (ch->pitchgoal)
  352.         ch->adjust = do_portamento;
  353.    }
  354.  
  355.  
  356.  
  357.  
  358. /***
  359.  ***    combined commands
  360.  ***/
  361.  
  362. LOCAL void do_portaslide(ch)
  363. struct channel *ch;
  364.    {
  365.    do_portamento(ch);
  366.    do_slidevol(ch);
  367.    }
  368.  
  369. LOCAL void set_portaslide(a, ch)
  370. struct automaton *a;
  371. struct channel *ch;
  372.    {
  373.    ch->adjust = do_portaslide;
  374.    if (a->pitch)
  375.       ch->pitchgoal = a->pitch;
  376.    parse_slidevol(ch, a->para);
  377.    }
  378.  
  379. LOCAL void do_vibratoslide(ch)
  380. struct channel *ch;
  381.    {
  382.    do_vibrato(ch);
  383.    do_slidevol(ch);
  384.    }
  385.  
  386. LOCAL void set_vibratoslide(a, ch)
  387. struct automaton *a;
  388. struct channel *ch;
  389.    {
  390.    ch->adjust = do_vibratoslide;
  391.    parse_slidevol(ch, a->para);
  392.     if (ch->resetvib)
  393.         ch->viboffset = 0;
  394.    }
  395.  
  396.  
  397.  
  398.  
  399. /***
  400.  ***    effects that just need a setup part
  401.  ***/
  402.  
  403. /* IMPORTANT: because of the special nature of the player, we can't 
  404.  * process each effect independently, we have to merge effects from 
  405.  * the four channel before doing anything about it. For instance, 
  406.  * there can be several speed change in the same note.
  407.  */
  408. LOCAL void set_speed(a, ch)
  409. struct automaton *a;
  410. struct channel *ch;
  411.    {
  412.    if (a->para >= 32 && get_pref_scalar(PREF_SPEEDMODE) != OLD_SPEEDMODE)
  413.       {
  414.       a->new_finespeed = a->para;
  415.       a->do_stuff |= SET_FINESPEED;
  416.       }
  417.    else if (a->para)
  418.       {
  419.       a->new_speed = a->para;
  420.       a->do_stuff |= SET_SPEED;
  421.       }
  422.    }
  423.  
  424. LOCAL void set_skip(a, ch)
  425. struct automaton *a;
  426. struct channel *ch;
  427.    {
  428.       /* BCD decoding in read.c */
  429.    a->new_note = a->para;
  430.    a->do_stuff |= SET_SKIP;
  431.    }
  432.  
  433. LOCAL void set_fastskip(a, ch)
  434. struct automaton *a;
  435. struct channel *ch;
  436.    {
  437.    a->new_pattern = a->para;
  438.    a->do_stuff |= SET_FASTSKIP;
  439.    }
  440.  
  441. /* immediate effect: starts the sample somewhere
  442.  * off the start.
  443.  */
  444. LOCAL void set_offset(a, ch)
  445. struct automaton *a;
  446. struct channel *ch;
  447.    {
  448.     if (a->para)
  449.         ch->start_offset = a->para * 256;
  450.    set_position(ch, ch->start_offset);
  451.    }
  452.  
  453. /* change the volume of the current channel. Is effective until there 
  454.  * is a new set_volume, slide_volume, or an instrument is reloaded 
  455.  * explicitly by giving its number. Obviously, if you load an instrument 
  456.  * and do a set_volume in the same note, the set_volume will take precedence.
  457.  */
  458. LOCAL void set_volume(a, ch)
  459. struct automaton *a;
  460. struct channel *ch;
  461.    {
  462.    set_current_volume(ch, a->para);
  463.    }
  464.  
  465.  
  466.  
  467.  
  468. /***
  469.  ***    extended commands
  470.  ***/
  471.  
  472. /* retrig note at a fast pace
  473.  */
  474. LOCAL void do_retrig(ch)
  475. struct channel *ch;
  476.    {
  477.    if (--ch->current <= 0)
  478.       {
  479.       reset_note(ch, ch->note, ch->pitch);
  480.       ch->current = ch->retrig;
  481.       }
  482.    }
  483.  
  484. LOCAL void set_retrig(a, ch)
  485. struct automaton *a;
  486. struct channel *ch;
  487.    {
  488.    ch->retrig = a->para;
  489.    ch->current = ch->retrig;
  490.    ch->adjust = do_retrig;
  491.    }
  492.  
  493. /* start note after a small delay
  494.  */
  495. LOCAL void do_latestart(ch)
  496. struct channel *ch;
  497.    {
  498.    if (--ch->current <= 0)
  499.       {
  500.       reset_note(ch, ch->note, ch->pitch);
  501.       ch->adjust = do_nothing;
  502.       }
  503.    }
  504.  
  505. LOCAL void set_late_start(a, ch)
  506. struct automaton *a;
  507. struct channel *ch;
  508.    {
  509.    play_note(ch->audio, empty_sample() , 0);
  510.    ch->current = a->para;
  511.    ch->adjust = do_latestart;
  512.    }
  513.  
  514. /* cut note after some time. Note we only kill the volume, 
  515.  * as protracker does (compatibility...)
  516.  */
  517. LOCAL void do_cut(ch)
  518. struct channel *ch;
  519.    {
  520.    if (ch->retrig)
  521.       {
  522.       if (--ch->retrig == 0)
  523.          set_current_volume(ch, 0);
  524.       }
  525.    }
  526.  
  527. LOCAL void set_note_cut(a, ch)
  528. struct automaton *a;
  529. struct channel *ch;
  530.    {
  531.    ch->retrig = a->para;
  532.    ch->adjust = do_cut;
  533.    }
  534.  
  535.  
  536. LOCAL void set_smooth_up(a, ch)
  537. struct automaton *a;
  538. struct channel *ch;
  539.    {
  540.    ch->pitch += a->para;
  541.    ch->pitch = MIN(ch->pitch, MAX_PITCH);
  542.    ch->pitch = MAX(ch->pitch, MIN_PITCH);
  543.    set_current_pitch(ch, ch->pitch);
  544.    }
  545.  
  546. LOCAL void set_smooth_down(a, ch)
  547. struct automaton *a;
  548. struct channel *ch;
  549.    {
  550.    ch->pitch -= a->para;
  551.    ch->pitch = MIN(ch->pitch, MAX_PITCH);
  552.    ch->pitch = MAX(ch->pitch, MIN_PITCH);
  553.    set_current_pitch(ch, ch->pitch);
  554.    }
  555.  
  556. LOCAL void set_change_finetune(a, ch)
  557. struct automaton *a;
  558. struct channel *ch;
  559.    {
  560.    ch->finetune = a->para;
  561.     if (a->note != NO_NOTE)
  562.         {
  563.         a->pitch = pitch_table[a->note][ch->finetune];
  564.         reset_note(ch, a->note, a->pitch);
  565.         }
  566.    }
  567.  
  568.  
  569. LOCAL void set_loop(a, ch)
  570. struct automaton *a;
  571. struct channel *ch;
  572.    {
  573.       /* Note: the current implementation of protracker
  574.        * does not allow for a jump from pattern to pattern,
  575.        * even though it looks like a logical extension to the current 
  576.        * format.
  577.        */
  578.    if (a->para == 0) 
  579.       ch->loop_note_num = a->note_num;
  580.    else
  581.       {
  582.       if (ch->loop_counter == -1)
  583.          ch->loop_counter = a->para + 1;
  584.       /* We have to defer the actual note jump
  585.        * to automaton.c, because some modules include several
  586.        * loops on the same measure, which is a bit confusing
  587.        * (see don't you want me for a good example)
  588.        */
  589.        ch->loop_counter--;
  590.         if (ch->loop_counter > 0)
  591.            {
  592.            a->do_stuff |= JUMP_PATTERN;
  593.             a->loop_note_num = ch->loop_note_num;
  594.             }
  595.         else
  596.             ch->loop_counter = -1;
  597.         }
  598.    }
  599.  
  600. LOCAL void set_smooth_upvolume(a, ch)
  601. struct automaton *a;
  602. struct channel *ch;
  603.    {
  604.    set_current_volume(ch, ch->volume + a->para);
  605.    }
  606.  
  607. LOCAL void set_smooth_downvolume(a, ch)
  608. struct automaton *a;
  609. struct channel *ch;
  610.    {
  611.    set_current_volume(ch, ch->volume - a->para);
  612.    }
  613.  
  614.  
  615. LOCAL void set_delay_pattern(a, ch)
  616. struct automaton *a;
  617. struct channel *ch;
  618.    {
  619.    a->delay_counter = (a->para + 1);
  620.    }
  621.  
  622.  
  623.  
  624. void set_gliss_ctrl(a, ch)
  625. struct automaton *a;
  626. struct channel *ch;
  627.     {
  628.     if (a->para)
  629.         {
  630.         ch->funk_glissando = TRUE;
  631. /*        notice("Funk true");        */
  632.         }
  633.     else
  634.         {
  635.         ch->funk_glissando = FALSE;
  636. /*        notice("Funk false");    */
  637.         }
  638.     }
  639.  
  640. void set_vibrato_wave(a, ch)
  641. struct automaton *a;
  642. struct channel *ch;
  643.     {
  644.     ch->vibtable = vibrato_table[a->para & 3];
  645.     if (a->para & 4)
  646.         ch->resetvib = FALSE;
  647.     else
  648.         ch->resetvib = TRUE;
  649.     }
  650.  
  651. void set_tremolo_wave(a, ch)
  652. struct automaton *a;
  653. struct channel *ch;
  654.     {
  655.     ch->tremtable = vibrato_table[a->para & 3];
  656.     if (a->para & 4)
  657.         ch->resettrem = FALSE;
  658.     else
  659.         ch->resettrem = TRUE;
  660.     }
  661.  
  662. LOCAL void do_invert(ch)
  663. struct channel *ch;
  664.     {
  665.     ch->invert_offset += ch->invert_speed;
  666.     if (ch->invert_offset >= 128)
  667.         {
  668.         ch->invert_offset = 0;
  669.         if (ch->samp->rp_length)
  670.             {
  671.             if (++ch->invert_position >= ch->samp->rp_length)
  672.                 ch->invert_position = 0;
  673.             ch->samp->rp_start[ch->invert_position] = -1 
  674.                 - ch->samp->rp_start[ch->invert_position];
  675.             }
  676.         }
  677.     }
  678.  
  679. LOCAL void set_invert_loop(a, ch)
  680. struct automaton *a;
  681. struct channel *ch;
  682.     {
  683.     LOCAL unsigned char funk_table[] =
  684.         {0, 5, 6, 7, 8, 10, 11, 13, 16, 19, 22, 26, 32, 43, 64, 128};
  685.     if (a->para)
  686.         {
  687.         ch->invert_speed = funk_table[a->para];
  688.         ch->special = do_invert;
  689.         }
  690.     else
  691.         ch->special = do_nothing;
  692.     }
  693.  
  694.  
  695. /* initialize the whole effect table */
  696. void init_effects(table)
  697. void (*table[]) P((struct automaton *a, struct channel *ch));
  698.    {
  699.    int i;
  700.  
  701.    for (i = 0; i < NUMBER_EFFECTS; i++)
  702.       table[i] = set_nothing;
  703.    table[EFF_ARPEGGIO] = set_arpeggio;
  704.    table[EFF_SPEED] = set_speed;
  705.    table[EFF_SKIP] = set_skip;
  706.    table[EFF_FF] = set_fastskip;
  707.    table[EFF_VOLUME] = set_volume;
  708.    table[EFF_VOLSLIDE] = set_slidevol;
  709.    table[EFF_OFFSET] = set_offset;
  710.    table[EFF_PORTA] = set_portamento;
  711.    table[EFF_PORTASLIDE] = set_portaslide;
  712.    table[EFF_UP] = set_upslide;
  713.    table[EFF_DOWN] = set_downslide;
  714.    table[EFF_VIBRATO] = set_vibrato;
  715.    table[EFF_VIBSLIDE] = set_vibratoslide;
  716.    table[EFF_SMOOTH_UP] = set_smooth_up;
  717.    table[EFF_SMOOTH_DOWN] = set_smooth_down;
  718.    table[EFF_CHG_FTUNE] = set_change_finetune;
  719.    table[EFF_LOOP] = set_loop;
  720.    table[EFF_RETRIG] = set_retrig;
  721.    table[EFF_S_UPVOL] = set_smooth_upvolume;
  722.    table[EFF_S_DOWNVOL] = set_smooth_downvolume;
  723.    table[EFF_NOTECUT] = set_note_cut;
  724.    table[EFF_LATESTART] = set_late_start;
  725.    table[EFF_DELAY] = set_delay_pattern;
  726.     table[EFF_TREMOLO] = set_tremolo;
  727.     table[EFF_GLISS_CTRL] = set_gliss_ctrl;
  728.     table[EFF_VIBRATO_WAVE] = set_vibrato_wave;
  729.     table[EFF_TREMOLO_WAVE] = set_tremolo_wave;
  730.     table[EFF_INVERT_LOOP] = set_invert_loop;
  731.    }
  732.  
  733.